package main.java.game.event;


import java.util.List;

import main.java.game.Card;
import main.java.game.Game;
import main.java.game.combatant.Monster;

public class DefenseFog extends Event {
	public DefenseFog(String name, Boolean subscribed){
		super(name,subscribed);
		
	}
	public void takeEffect(Game game){
		super.takeEffect(game);
		List<Card> listM =game.getAdventurePile();
		for(Card card: listM){
			if(card instanceof Monster){
				Monster monster = (Monster) card;
				monster.setInit(monster.getInit()+4);
			}
		}
		System.out.println("All the monsters have 4 additional init points, until the end of the turn!\n");
	}
	public void update(Game game, Integer round) {
		List<Card> listM =game.getAdventurePile();
		for(Card card: listM){
			if(card instanceof Monster){
				Monster monster = (Monster) card;
				monster.setInit(monster.getInit()-4);
			}
		}	
		game.deleteObserver(this);
		
	}

}
